package com.pwc.conversionTool.relation;

import static com.pwc.conversionTool.IO.Writer.writeObjectToJson;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletContext;

import org.dom4j.DocumentException;

import com.pwc.conversionTool.Manager.SoapUIManager;
import com.pwc.conversionTool.Manager.XMLConfigImpl;
import com.pwc.conversionTool.csv.CsvHelper;

public class RelationManager {

	private String path;

	public RelationManager(String path) {
		this.path = path;
	}

	public void createRelation(String filePath, String operationName,
			String relationName) throws IOException, DocumentException {
		Map<String, String> relationMap = new HashMap<String, String>();
		relationMap.put("endpoint", SoapUIManager.getUrl());
		relationMap.put("csv-key", new CsvHelper(filePath).getKey());
		relationMap.put("operationName", operationName);
		writeObjectToJson(relationMap, path + File.separator + relationName);

	}

	public File[] getRelationFiles() {
		
		return null;
	}

}
